/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.tvunetworks.service.impl;

import com.tvunetworks.dao.CategoryDao;
import com.tvunetworks.dao.ItemDao;
import com.tvunetworks.dao.ProductDao;
import com.tvunetworks.model.Category;
import com.tvunetworks.model.Item;
import com.tvunetworks.model.Product;
import com.tvunetworks.service.CategoryManager;
import java.util.List;
import org.springframework.beans.factory.annotation.Required;

/**
 *
 * @author michael
 */
public class CategoryManagerImpl extends GenericManagerImpl<Category, String> implements CategoryManager {

    private ItemDao itemDao;
    private ProductDao productDao;
    private CategoryDao categoryDao;

    public CategoryDao getCategoryDao() {
        return categoryDao;
    }

    @Required
    public void setCategoryDao(CategoryDao categoryDao) {
        this.categoryDao = categoryDao;
    }

    public ItemDao getItemDao() {
        return itemDao;
    }

    @Required
    public void setItemDao(ItemDao itemDao) {
        this.itemDao = itemDao;
    }

    public ProductDao getProductDao() {
        return productDao;
    }

    @Required
    public void setProductDao(ProductDao productDao) {
        this.productDao = productDao;
    }

    public Category getCategory(String categoryId) {
        return categoryDao.getCategory(categoryId);
    }

    public List<Category> getCategoryList() {
        return categoryDao.getCategoryList();
    }

    public Item getItem(String itemId) {
        return itemDao.getItem(itemId);
    }

    public List<Item> getItemListByProduct(String productId) {
        return itemDao.getItemListByProduct(productId);
    }

    public Product getProduct(String productId) {
        return productDao.getProduct(productId);
    }

    public List<Product> getProductListByCategory(String categoryId) {
        return productDao.getProductListByCategory(categoryId);
    }

    public boolean isItemInStock(String itemId) {
        return itemDao.isItemInStock(itemId);
    }

    public List<Product> searchProductList(String keywords) {
        return productDao.searchProductList(keywords);
    }
}
